#cmake_minimum_required(VERSION 2.6)

project(zhalib)

#ADD_SUBDIRECTORY(net) 

INCLUDE_DIRECTORIES(extern_libs/lua-5.2.0/src)

aux_source_directory(./net FILES_NET)
aux_source_directory(./event FILES_EVENT)
aux_source_directory(./utils FILES_UTILS)
aux_source_directory(./lua FILES_LUA)

#SET_TARGET_PROPERTIES(zhalib PROPERTIES LINKER_LANGUAGE C)

SET(SRC_LIST ${FILES_NET} ${FILES_EVENT} ${FILES_UTILS} ${FILES_LUA})

ADD_LIBRARY(zha SHARED ${SRC_LIST})
ADD_LIBRARY(zha_static STATIC ${SRC_LIST})

#LINK_DIRECTORIES(/usr/local/lib)
SET(LINK_LIB_DIR 
		event 
		/usr/local/lib/liblua.so 
		dl
		#lualib50
   )

SET_TARGET_PROPERTIES(zha_static PROPERTIES OUTPUT_NAME "zha")

TARGET_LINK_LIBRARIES(zha ${LINK_LIB_DIR})


